#ifndef __LV_COMMON_FUNCTION_H__
#define __LV_COMMON_FUNCTION_H__

//#include "fr_lv_public_func.h"
//#include "lan_str_table.h"
#include "fr_watch.h"
//#include "fr_lv_app_page.h"
 
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_92px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_80px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_62px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_50px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_46px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_44px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_36px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_20px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_12px);
LV_FONT_DECLARE(Number_HarmonyOS_bpp4_16px);
LV_FONT_DECLARE(arialuni_bbp1_32px);

#define     LV_FONT_BIG_NUMBER_62PX       &Number_HarmonyOS_bpp4_62px
#define     LV_FONT_BIG_NUMBER_50PX       &Number_HarmonyOS_bpp4_50px
#define     LV_FONT_BIG_NUMBER_46PX       &Number_HarmonyOS_bpp4_46px
#define     LV_FONT_BIG_NUMBER_44PX       &Number_HarmonyOS_bpp4_44px
#define     LV_FONT_SMALL_NUMBER_20PX     &Number_HarmonyOS_bpp4_20px
#define     LV_FONT_SMALL_NUMBER_12PX     &Number_HarmonyOS_bpp4_12px
#define     LV_FONT_SMALL_NUMBER_16PX     &Number_HarmonyOS_bpp4_16px
#define 	LV_FONT_MEDIUM_NUMBER_36PX 	  &Number_HarmonyOS_bpp4_36px
#define     LV_FONT_ARIALUNI_ALL_32PX      &arialuni_bbp1_32px

#define KEY1_CODE	134
#define KEY2_CODE	135
#define KEY3_CODE	136
#define KEY4_CODE	137
#define KEY5_CODE	138


//=============================================
//--------------- define ----------------------
//=============================================
extern LV_ATTRIBUTE_LARGE_CONST const ui_func style_func_arry[];
#define UI_PARENT_INIT(PARENT)      do{lv_obj_set_size(PARENT,LV_PCT(100),LV_PCT(100));\
    lv_obj_set_style_bg_color(PARENT,lv_color_black(),0); \
    lv_obj_set_style_pad_all(PARENT,0,0); \
    lv_obj_set_style_border_width(PARENT, 0, 0); \
    lv_obj_set_scrollbar_mode(PARENT, LV_SCROLLBAR_MODE_OFF);}while(0)

 
void lv_img_big_disp(lv_obj_t* parent, const lv_img_dsc_t **src , lv_coord_t x, lv_coord_t y,uint8_t img_num,uint8_t start);
lv_obj_t* lv_img_big_create(lv_obj_t* parent, const lv_img_dsc_t **src , lv_coord_t x, lv_coord_t y,uint8_t img_num,uint8_t start);	
	
void user_jump_page(ui_func func);

//------------------- end ----------------------
typedef enum
{
	UI_MAIN_FLOAT = 0,
    UI_APP_MUSIC,
    UI_APP_SPORT_DETAIL,
    UI_APP_OTA,

} ui_type_t;


//=============================================
//--------------- about time ------------------
//=============================================
extern time_rtc_t *fr_system_get_time_rtc(void);
extern uint8_t fr_system_get_time_week(void);;
extern uint8_t fr_system_get_time_hour(void);
extern uint8_t fr_system_get_time_minute(void);
extern uint8_t fr_system_get_time_second(void);
extern void fr_system_set_time_hour(uint8_t temp_data);
extern void fr_system_set_time_minute(uint8_t temp_data);
extern void fr_system_set_time_second(uint8_t temp_data);
extern void fr_system_set_time_format(uint8_t temp_data);
//------------------- end ----------------------

//=============================================
//---------- about watch setting --------------
//=============================================
extern uint16_t fr_system_get_fw_version(void);
extern uint8_t *fr_system_get_mac_address(void);
extern void fr_system_set_Wirst_Awake(uint8_t state);
extern uint8_t fr_system_Wirst_Awake(void);
extern void fr_system_set_no_disturb(uint8_t state);
extern uint8_t fr_system_no_disturb(void);
extern void fr_system_set_panel_on_time(uint8_t value);
extern uint8_t fr_system_panel_on_time(void);
extern void fr_system_set_language(uint8_t id);
extern uint8_t fr_system_get_language(void);
extern void fr_system_set_backlight(uint8_t id);
extern uint8_t fr_system_get_backlight(void);
extern uint8_t fr_system_get_ble_state(void);
extern uint8_t fr_system_get_bt_state(void);
extern uint8_t fr_system_get_battery_state(void);
extern uint8_t fr_system_get_battery_value(void);
extern uint8_t *fr_system_get_sleep_distory(void);
extern uint16_t fr_system_get_sleep_total_time(void);
extern uint16_t fr_system_get_sleep_d_time(void);
extern uint16_t fr_system_get_sleep_l_time(void);
extern uint8_t fr_system_get_day1_weather_type(void);
extern void fr_system_set_weather_temperature_format(uint8_t temp_data);
extern uint8_t fr_system_get_weather_temperature_format(void);
extern int16_t centigrade2fahrenhite(int16_t centigrade_data);
extern int16_t fr_system_get_day1_weather_temp(void);
extern int16_t fr_system_get_day1_weather_temp_m(void);
extern int16_t fr_system_get_day1_weather_temp_n(void);
extern int16_t fr_system_get_day2_weather_temp(void);
extern int16_t fr_system_get_day2_weather_temp_m(void);
extern int16_t fr_system_get_day2_weather_temp_n(void);
extern int16_t fr_system_get_day3_weather_temp(void);
extern int16_t fr_system_get_day3_weather_temp_m(void);
extern int16_t fr_system_get_day3_weather_temp_n(void);
//------------------- end ----------------------
//sport
extern uint32_t fr_system_get_sport_time(void);
extern uint8_t fr_system_get_sport_type(void);
extern uint16_t fr_system_get_sport_speed(void);
extern uint16_t fr_system_get_sport_step(void);
extern uint16_t fr_system_get_sport_carlorie(void);
extern uint16_t fr_system_get_sport_distcace(void);
extern uint8_t fr_system_get_sport_state(void);
extern uint8_t fr_system_get_sport_hrm(void);
extern uint8_t fr_system_get_sport_hrm_max(void);
extern uint8_t fr_system_get_sport_hrm_min(void);
extern uint8_t fr_system_get_sport_oxygen(void);
extern uint32_t fr_system_get_sport_total_time(void);
extern uint16_t fr_system_get_sport_total_carlorie(void);
extern uint8_t fr_system_get_sport_avg_hrm(void);
extern void fr_system_sports_start(uint8_t mode);
extern void fr_system_sports_stop(uint8_t mode);
extern void fr_system_sports_pause(uint8_t mode);
extern void fr_system_turn_on_bt(void);
extern void fr_system_turn_off_bt(void);
extern void fr_system_shut_down(void);
extern void fr_system_reset_to_factory(void);
extern void fr_system_reboot(void);
extern void fr_system_power_off(void);
extern void fr_system_enable_mic(void);
extern void fr_system_disable_mic(void);
extern uint8_t fr_system_get_mic_state(void);
extern void fr_system_set_step_target(uint32_t temp_data);
extern uint32_t fr_system_get_step_target(void);
extern uint32_t fr_system_get_step(void);
extern uint32_t fr_system_get_calorie(void);
extern uint8_t fr_system_get_distance_format(void);
extern uint32_t fr_system_get_distance(void);
extern void fr_system_clear_light_time(void);
extern void fr_system_take_picture(void);
extern void fr_system_search_phone(void);
extern void fr_system_set_menu_style(uint8_t id);
extern uint8_t fr_system_get_menu_style(void);
extern void fr_system_set_watch_face( uint8_t id);
extern uint8_t fr_system_get_watch_face(void);
extern uint8_t* fr_system_get_custom_page_mode(void);
extern void fr_system_set_custom_page_mode(void);

//------------------- end ----------------------

//=============================================
//--------------- about call ------------------
//=============================================
extern uint8_t fr_system_get_call_mode(void);
extern void fr_system_set_call_mode(uint8_t mode);
extern void dsp_op_system_call_out(uint8_t * number,uint8_t len);
extern void dsp_op_get_current_call(call_info_t * call);
extern uint8_t dsp_op_dial_from_book(uint16_t id);
extern void dsp_op_get_call_from_book(call_info_t * call,uint16_t id);
extern void dsp_op_get_phone_book_tatol(void);
extern void dsp_op_sync_phone_book(void);
extern uint16_t dsp_op_get_phone_book_id_offset(void);
extern uint16_t dsp_op_set_phone_book_id_offset(uint16_t id_offset);
extern void dsp_op_system_call_ok(void);
extern void dsp_op_system_call_reject(void);
extern void dsp_op_read_cm3_record_list(void);
extern void dsp_op_get_call_from_record_list(call_info_t * call,uint8_t *call_context);
extern uint8_t dsp_get_system_record_total(void);

//------------------- end ----------------------

//=============================================
//--------------- about node ------------------
//=============================================
extern void dsp_store_ui_scene(uint8_t mode,uint8_t layer, uint8_t page,uint16_t page_cur_x,uint16_t page_cur_y);
extern void dsp_set_ui_scene_default_style(uint8_t type);
extern uint8_t dsp_get_ui_scene_default_style(void);
extern uint8_t fr_system_panel_state(void);
extern uint8_t dsp_get_ui_scene_mode(void);
extern uint8_t dsp_get_ui_scene_page_id(void);
//------------------- end ----------------------

//=============================================
//---------- about host recv vendor------------
//=============================================
void fr_system_host_recv_vendor(uint8_t *recv_data,uint8_t len);
//------------------- end ----------------------

//=============================================
//--------------- about hrm -------------------
//=============================================
extern uint8_t fr_system_get_hrm_status(void);
extern void fr_system_hrm_start(void);
extern void fr_system_hrm_stop(void);
extern uint8_t fr_system_get_hrm(void);
extern uint8_t fr_system_get_hrm_warning_h(void);
extern uint8_t fr_system_get_hrm_warning_l(void);
extern void fr_system_spo2_start(void);
extern void fr_system_spo2_stop(void);
extern uint8_t fr_system_get_spo2(void);
extern uint8_t fr_system_get_spo2_status(void);
//------------------- end ----------------------

//=============================================
//------------- about gsensor -----------------
//=============================================
void fr_system_send_step_cmd(void);
//------------------- end ----------------------

//=============================================
//-------- extern file declare ----------------
//=============================================
extern void fr_lv_app_starsky_func(lv_obj_t *parent,lv_point_t *top);
extern void fr_lv_track_roller_func(lv_obj_t *parent,lv_point_t *top);
//extern ui_func fr_ui_get_watchface(void);
extern void fr_lv_home_short_sqlist_save_data(uint8_t ui_array_index);
extern void lv_app_msg_win(lv_obj_t *parent,lv_point_t *top);
extern bool fr_lv_get_charge_ui_state(void);
extern void offscreen_dial_charge_create(void);
extern void offscreen_dial_charge_clean(void);
extern void fr_lv_app_dialing_function(lv_obj_t *parent,lv_point_t *top);
extern void fr_system_update_utc_time(time_rtc_t *cur_time);
//------------------- end ----------------------


void fr_lv_86box_page1_func(lv_obj_t *parent, lv_point_t *top);
void fr_lv_86box_page2_func(lv_obj_t *parent, lv_point_t *top);
void fr_lv_instrument_panel_func(lv_obj_t *parent, lv_point_t *top);
void fr_lv_instrument_panel_km_func(lv_obj_t *parent, lv_point_t *top);
void fr_lv_app_music_control_func(lv_obj_t *parent,lv_point_t *top);
void fr_list_page(lv_obj_t* parent,lv_point_t *top);
void fr_can_page(lv_obj_t* parent,lv_point_t *top);
void fr_test_page_func(lv_obj_t* parent,lv_point_t *top);
void fr_logo_page_func(lv_obj_t* parent,lv_point_t *top);
void fr_bt_pan_page(lv_obj_t* parent,lv_point_t *top);
#endif
